<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>

<tiles:insertTemplate template="/tiles/layout.jsp">
	<tiles:putAttribute name="selected" value="planes" />
	<tiles:putAttribute name="submenu">
		<ul>
			<sec:authorize access="hasRole('ROLE_ADMIN')">
			<li><a href="${pageContext.request.contextPath}/planes/nuevo-plan.action" class="pagenew">Nuevo Plan</a></li>
			<li><a href="${pageContext.request.contextPath}/planes/liquidar.action" class="pagenew">Liquidar Planes</a></li>
			</sec:authorize>
		</ul>
	</tiles:putAttribute>
	<tiles:putAttribute name="body">
		
		<div id="box">
		
		<h3>Consolidar Cobro de plan</h3> 
		
		<div id="infobox" class="margin-left">
				<h3>Cobro Nro. <c:out value="${cobro.numero}" /></h3>
				<table> 
					<thead>
					</thead>
					<tbody>
						<tr><td><b>N&uacute;mero</b></td><td><c:out value="${cobro.numero}" /></td></tr>
						<tr><td><b>Monto</b></td><td>$<c:out value="${cobro.monto}" /></td></tr>
						<tr><td><b>Intereses</b></td><td>$<c:out value="${cobro.interesesFinancieros}" /></td></tr>
						<tr><td><b>Fecha</b></td><td><fmt:formatDate pattern="dd/MM/yyyy" value="${cobro.fecha}" /></td></tr>
						<tr><td><b>Comprobante</b></td><td><c:out value="${cobro.comprobante}" /></td></tr>
						<c:if test="${!cobro.consolidado}">
							<tr><td><b>Consolidado</b></td><td>NO</td></tr>
						</c:if>
						<c:if test="${cobro.consolidado}">
							<tr><td><b>Consolidado</b></td><td>SI</td></tr>
						</c:if>
					</tbody>
				</table>
			</div>

 	<div id="infobox" class="margin-left">
 		<s:actionerror/>
 		<s:fielderror/>
		<s:form action="consolidar2" id="form" namespace="/planes">
			<fieldset id="cobro">
				<legend>Consolidar</legend>
				<s:hidden name="cobro.id"></s:hidden>
				<s:textfield name="comprobante" label="Comprobante" maxlength="10" required="true"/>
			</fieldset>
		
			<div align="center">
            	<input id="button1" type="submit" value="Guardar" /> 
			</div>
				
			</s:form>
					
		</div>
	</div>
	</tiles:putAttribute>
</tiles:insertTemplate>